#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
void contra_solem(char arr[10], int sz,int k)
{
	char arr1[10] = { 0 };
	char arr2[10] = { 0 };
	int i = 0;
	for (i = 0; i < k; i++)
	{
		arr1[i] = arr[i];
	}
	for (; i < sz; i++)
	{
		arr2[i] = arr[i];
	}
	for (i = 0; i < sz -k; i++)
	{
		arr[i] = arr2[i+k];
	}
	for (i = 0; i < k; i++)
	{
		arr[i+sz-k] = arr1[i];
	}

}
int main()
{
	char arr[10] = "ABCDEFG";
	int k = 0;
	scanf("%d",&k);
	int sz = strlen(arr);
	contra_solem(arr,sz,k);
	printf("%s",arr);
	return 0;
}